<?php $this->_extends('_layouts/htmltemplatepreview_layout'); ?>

<?php $this->_block('title'); ?>预览页面 - <?php echo $root; ?><?php $this->_endblock(); ?>

<?php 
	$this->_block('backurl'); 
	echo url('htmltemplate/detail', array('id'=> $id));
	$this->_endblock(); 

	$this->_block('download_packurl'); 
	echo isset($download_pack)? $htmltemp_url . $root . '/' . $download_pack : 'javascript: void(0)';
	$this->_endblock(); 

	$this->_block('download_txt'); 
	echo isset($download_pack)? '下载此模板' : '暂时没有提供下载';
	$this->_endblock(); 
?>

<?php $this->_block('contents'); ?>
	<script language="javascript" type="text/javascript">
		function dyniframesize(down)
		{
			var pTar = null;
			if (document.getElementById){
				pTar = document.getElementById(down);
			}else{
				eval('pTar = ' + down + ';');
			}
			if (pTar && !window.opera){
				//begin resizing iframe
				pTar.style.display="block"
				if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight){
					//ns6 syntax
					pTar.height = pTar.contentDocument.body.offsetHeight +20;
					pTar.width = pTar.contentDocument.body.scrollWidth+20;
				}else if (pTar.Document && pTar.Document.body.scrollHeight){
					//ie5+ syntax
					pTar.height = pTar.Document.body.scrollHeight;
					pTar.width = pTar.Document.body.scrollWidth;
				}
			}
		}
	</script>
	
	<iframe src ="<?php echo $htmltemp_url . $root . '/' . $indexpage; ?>" frameborder="0" marginheight="0" marginwidth="0" frameborder="0" scrolling="no" id="ifm" name="ifm" onload="javascript:dyniframesize('ifm');" width="100%"></iframe> 

<?php $this->_endblock(); ?>


</html>